import java.text.SimpleDateFormat

/*
var option = "all2"
if (option == "all")
  print("true")
else
  print("false")
*/


/**
 *
 * @param date  conv2ts("2015-05-09")
 * @return  Unknown
 */
def  conv2ts(date:String):Long={
  try {
    new SimpleDateFormat("yyyy-MM-dd").parse(date.toString).getTime/1000L.toLong

  } catch {
    case e: Exception => Some(new java.sql.Timestamp(0)).get.getTime
    case _: Throwable =>Some(new java.sql.Timestamp(0)).get.getTime
  }
}

conv2ts("2015-05-09")